﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddEgressionInfo.aspx.cs" Inherits="admin_AddEgressionInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
       
        <link rel="Stylesheet" type="text/css" href="../Styles/right_style.css" />
    <script type="text/javascript" src="../Scripts/jquery.ui/js/jquery.js"></script>
        <script type="text/javascript" src="../Scripts/My97DatePicker/WdatePicker.js"></script>

    <style type="text/css">
<!--
html{ scrollbar-base-color: #dbecf8; scrollbar-arrow-color: #2a8ed1; scrollbar-track-color: #bdddf2; scrollbar-3dlight-color: #2886c5; scrollbar-darkshadow-color: #2886c5;
scrollbar-face-color: #dbecf8; scrollbar-shadow-color: #dbecf8;  }
-->
</style>

</head>
<body>
    <form id="form1" runat="server">
        <div class="sub_right_top">
  <div class="hdm_header" >
    <div class="tb1_on"><h2 class="h2_icon">外出登记</h2></div>

    <div class="clear"></div>
  </div>
  <div class="hdm_footer">
  <br />
    <div class="dengji_kong"></div>  
    <table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#77acd0" style="border-collapse:collapse; ">
      <tr>
        <td colspan="5" style=" font-size:14px; font-weight:bold;">外出登记</td>
      </tr>

      <tr>
        <td width="80" align="center">外出原因</td>
        <td colspan="4">
          <asp:TextBox ID="txtEgressionRemark" runat="server" Height="200px" TextMode="MultiLine" Width="400px"></asp:TextBox></td>
      </tr>
      <tr>
        <td width="80" align="center">外出时间</td>

        <td width="80" align="center">起始时间</td>
        <td>
          <asp:TextBox ID="txtBeginTime" runat="server" CssClass="Wdate" onClick="WdatePicker({dateFmt:'HH:mm'})"></asp:TextBox></td>
        <td width="80" align="center">终止时间</td>
        <td>
           <asp:TextBox ID="txtEndTime" runat="server" CssClass="Wdate" onClick="WdatePicker({dateFmt:'HH:mm'})"></asp:TextBox> </td>
      </tr>

      
      <tr>
        <td colspan="5">
            <asp:Button ID="Button1" runat="server" Text="" OnClick="Button1_Click" OnClientClick="return checkfrm()" CssClass="tijiao_anniu tijiao_pad"/>
            <asp:Button ID="Button2" runat="server" Text="" PostBackUrl="~/admin/EgressionInfoList.aspx" CssClass="fanhui_anniu"/>
         </td>
        </tr>
    </table>
  </div>
</div>
    </form>
</body>
</html>
<script language="javascript">
function checkfrm()
{
    if(document.getElementById('txtEgressionRemark').value=='')
    {
        alert('外出原因不能为空！');
        return false;
    }
    if(!CheckTime(document.getElementById('txtBeginTime').value))
    {
        alert('请输入格式正确的时间\n\r时间格式：hh:mm\n\r例    如：8:15\n\r');
        return false;
    }
    if(!CheckTime(document.getElementById('txtEndTime').value))
    {
        alert('请输入格式正确的时间\n\r时间格式：hh:mm\n\r例    如：8:15\n\r');
        return false;
    }
    return true;
}
function CheckTime (strTime)
{
    strTime = (TrimString (strTime));
    if (strTime.length == 0)
        return (false);
    reVal = /^(([0-9]|[01][0-9]|2[0-3])(:([0-9]|[0-5][0-9])){0,2}|(0?[0-9]|1[0-1])(:([0-9]|[0-5][0-9])){0,2}\s?[aApP][mM])?$/;
    return (reVal.test (strTime));
}
function CheckDate (strDate)
{
    var nStart;
    var nEnd;
    var nYear;
    var nMonth;
    var nDay;
    var nFact;
    var arrDay = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    strDate = (TrimString (strDate));
    if (strDate.length == 0)
        return (false);
    reVal = /^([1-2]\d{3})[\/|\-](0?[1-9]|10|11|12)[\/|\-]([1-2]?[0-9]|0[1-9]|30|31)$/;
    if (!reVal.test (strDate))
        return (false);
    nStart = strDate.indexOf ("/", 0);
    nEnd = strDate.indexOf ("/", nStart + 1);
    nYear = eval (strDate.substring (0, nStart));
    nMonth = eval (strDate.substring (nStart + 1, nEnd));
    nDay = eval (strDate.substring (nEnd + 1, strDate.length));
    nFact = arrDay[nMonth - 1];
    if (nMonth == 2)
    {
        if ((nYear % 4 == 0 && nYear %100 != 0) || (nYear % 400 == 0))
            nFact ++;
    };
    if (nDay > nFact)
        return (false);
    return (true);
}
function TrimString (strVal)
{
    strTmp = strVal + "";
    if (strTmp.length == 0)
        return (strTmp);
    reVal = /^(\s|　)*/;
    strTmp = strTmp.replace (reVal, '');
    reVal = /(\s|　)*$/;
    return (strTmp.replace (reVal, ''));
}
</script>